﻿using System;
using System.Collections.Specialized;
using Word = Microsoft.Office.Interop.Word;

namespace Linn {
    public abstract class DocumentBase : IDocument {
        
        protected DocumentBase(Word.Document document) {
            if(document == null) {
                throw new ArgumentNullException("document");
            }

            Document = document;
            Template = LoadTemplate();
            Values = new NameValueCollection();
        }

        protected Word.Document Document { get; private set; }

        public ITemplate Template { get; private set; }

        public NameValueCollection Values { get; private set; }

        protected abstract ITemplate LoadTemplate();

        public abstract void Update(NameValueCollection queryString);

        public string FullName { get { return Template.FullName; } }
    }
}
